import { Operation } from './operations'

export class RemoveTextOperations extends Operation {
  private startIndex_: any
  private endIndex_: number
  constructor(startIndex: any, endIndex: number) {
    super()
    this.startIndex_ = startIndex
    this.endIndex_ = endIndex
  }
  /**
   * @description 删除选取内容
   * @param editor editor 类
   */
  apply(editor: {
    getTextModel: () => {
      (): any
      new (): any
      remove: { (arg0: any, arg1: number): void; new (): any }
    }
  }) {
    editor.getTextModel().remove(this.startIndex_, this.endIndex_)
  }
}

export default RemoveTextOperations